﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components.mainmenu {
    import reprise.ui.*;
    import flash.events.*;
    import net.wooga.pets.events.*;

    public class DoctorsTabDisplay extends AbstractTabView {

        private static const NUMBER_OF_VISIBLE_ITEMS:int = 6;

        public function addDoctor(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String):void{
            if (this.getDoctorById(_arg1)){
                return;
            };
            removePlaceholders();
            var _local8:DoctorScrollItem = new DoctorScrollItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
            _local8.addEventListener(MouseEvent.CLICK, this.doctorItem_click);
            m_scrollPane.addItem(_local8);
            addPlaceholders();
        }
        public function getDoctorById(_arg1:String):DoctorScrollItem{
            var _local2:UIComponent;
            for each (_local2 in m_scrollPane.items) {
                if ((((_local2 is DoctorScrollItem)) && ((DoctorScrollItem(_local2).doctorId == _arg1)))){
                    return (DoctorScrollItem(_local2));
                };
            };
            return (null);
        }
        override protected function addPlaceholder():void{
            var _local1:PlaceholderScrollItem = PlaceholderScrollItem(m_scrollPane.addItem(new PlaceholderScrollItem("doctorsPlaceholderScrollItem")));
            m_placeholders.push(_local1);
        }
        public function removeDoctorById(_arg1:String):void{
            var _local2:DoctorScrollItem;
            removePlaceholders();
            _local2 = this.getDoctorById(_arg1);
            m_scrollPane.removeItem(_local2);
            addPlaceholders();
        }
        public function showHungry(_arg1:String):void{
            var _local2:DoctorScrollItem = this.getDoctorById(_arg1);
            ((_local2) && (_local2.showHungry()));
        }
        public function hideHungry(_arg1:String):void{
            var _local2:DoctorScrollItem = this.getDoctorById(_arg1);
            ((_local2) && (_local2.hideHungry()));
        }
        public function setHungryIn(_arg1:String, _arg2:String):void{
            if (isScrollPaneScrolling()){
                return;
            };
            var _local3:DoctorScrollItem = this.getDoctorById(_arg1);
            ((_local3) && (_local3.setHungryIn(_arg2)));
        }
        override protected function createChildren():void{
            m_scrollPane = ScrollPane(addChild(new ScrollPane(NUMBER_OF_VISIBLE_ITEMS)));
            m_scrollPane.addCSSClass("doctors");
        }
        private function doctorItem_click(_arg1:MouseEvent):void{
            var _local2:DoctorScrollItem = DoctorScrollItem(_arg1.currentTarget);
            dispatchEvent(new ViewCompEvent(ViewCompEvent.CLICK, _local2.doctorId));
        }

    }
}//package net.wooga.pets.views.components.mainmenu 
